------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  app
       log:  D:\JRI Distribution -- Data and Code\JRI -- Welfare Consequences of the Compound Risks of Index Insurance -- Selected Results.log
  log type:  text
 opened on:  20 Apr 2025, 13:35:00
.         log off app
      name:  app
       log:  D:\JRI Distribution -- Data and Code\JRI -- Welfare Consequences of the Compound Risks of Index Insurance -- Selected Results.log
  log type:  text
 paused on:  20 Apr 2025, 13:35:00
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  app
       log:  D:\JRI Distribution -- Data and Code\JRI -- Welfare Consequences of the Compound Risks of Index Insurance -- Selected Results.log
  log type:  text
resumed on:  20 Apr 2025, 13:35:01

. 
. * Tabulation of ROCL violations.        
. *********************************
. * Regenerate with one observation per subject (will be the same shape)
.         tab rocl_subj_viol if record==1

  Number of |
       ROCL |
 violations |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |          4        1.98        1.98
          1 |         17        8.42       10.40
          2 |         29       14.36       24.75
          3 |         40       19.80       44.55
          4 |         45       22.28       66.83
          5 |         23       11.39       78.22
          6 |         25       12.38       90.59
          7 |         13        6.44       97.03
          8 |          6        2.97      100.00
------------+-----------------------------------
      Total |        202      100.00

.         histogram rocl_subj_viol if record==1, discrete fraction fcolor(navy) lcolor(navy) gap(20) ytitle(Fraction, orient(horizontal)) ylabel(#10, labels valuelabel grid angle(horizontal)) ymtick(#10) xlabel
> (0(1)10, valuelabel) xtitle("Number of ROCL Violations", margin(medium)) xscale(range(0.4 4)) legend(off) saving(FigROCLviolationsALL.gph, replace)
(start=0, width=1)
file FigROCLviolationsALL.gph saved

.         gr export FigROCLviolationsALL.png, replace
file FigROCLviolationsALL.png saved as PNG format

. 
. log off app
      name:  app
       log:  D:\JRI Distribution -- Data and Code\JRI -- Welfare Consequences of the Compound Risks of Index Insurance -- Selected Results.log
  log type:  text
 paused on:  20 Apr 2025, 13:35:02
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  app
       log:  D:\JRI Distribution -- Data and Code\JRI -- Welfare Consequences of the Compound Risks of Index Insurance -- Selected Results.log
  log type:  text
resumed on:  20 Apr 2025, 13:35:04

. 
. * Tabulations for Table 3
. **************************
. 
. * Choices in the AE treatment: text Table 3
. 
. * Purchase of ROCL violators in AE treatment
. sum purchase if roclkill == 1 & ii_ae == 0

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
    purchase |      1,404    .5933048    .4913921          0          1

. 
. * Purchase of ROCL compliers in AE treatment
. sum purchase if roclkill == 0 & ii_ae == 0 

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
    purchase |      4,914    .5891331    .4920412          0          1

. 
. * Difference in means test in AE treatment
. ttest purchase if ii_ae == 0, by(roclkill)

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
---------+--------------------------------------------------------------------
       0 |   4,914    .5891331    .0070191    .4920412    .5753724    .6028937
       1 |   1,404    .5933048    .0131143    .4913921    .5675791    .6190306
---------+--------------------------------------------------------------------
Combined |   6,318    .5900601     .006188    .4918612    .5779295    .6021908
---------+--------------------------------------------------------------------
    diff |           -.0041718    .0148855               -.0333524    .0250088
------------------------------------------------------------------------------
    diff = mean(0) - mean(1)                                      t =  -0.2803
H0: diff = 0                                     Degrees of freedom =     6316

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.3896         Pr(|T| > |t|) = 0.7793          Pr(T > t) = 0.6104

. 
. * Choices in the II treatment: text Table 3
. * Purchase of ROCL violators in AE treatment
. sum purchase if roclkill == 1 & ii_ae == 1

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
    purchase |        972    .7016461    .4577712          0          1

. 
. * Purchase of ROCL compliers in AE treatment
. sum purchase if roclkill == 0 & ii_ae == 1 

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
    purchase |      3,564    .5656566      .49574          0          1

. 
. * Difference in means test in II treatment
. ttest purchase if ii_ae == 1, by(roclkill)

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
---------+--------------------------------------------------------------------
       0 |   3,564    .5656566     .008304      .49574    .5493756    .5819376
       1 |     972    .7016461     .014683    .4577712     .672832    .7304602
---------+--------------------------------------------------------------------
Combined |   4,536    .5947972    .0072901    .4909854    .5805051    .6090893
---------+--------------------------------------------------------------------
    diff |           -.1359895    .0176534               -.1705987   -.1013803
------------------------------------------------------------------------------
    diff = mean(0) - mean(1)                                      t =  -7.7033
H0: diff = 0                                     Degrees of freedom =     4534

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.0000         Pr(|T| > |t|) = 0.0000          Pr(T > t) = 1.0000

. 
. * Difference in means test in across treatments by ROCL violator
. ttest purchase if roclkill == 1, by(ii_ae)

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
---------+--------------------------------------------------------------------
Actuaria |   1,404    .5933048    .0131143    .4913921    .5675791    .6190306
Index In |     972    .7016461     .014683    .4577712     .672832    .7304602
---------+--------------------------------------------------------------------
Combined |   2,376    .6376263    .0098635    .4807872    .6182844    .6569682
---------+--------------------------------------------------------------------
    diff |           -.1083412     .019942               -.1474467   -.0692358
------------------------------------------------------------------------------
    diff = mean(Actuaria) - mean(Index In)                        t =  -5.4328
H0: diff = 0                                     Degrees of freedom =     2374

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.0000         Pr(|T| > |t|) = 0.0000          Pr(T > t) = 1.0000

. 
. * Difference in means test in across treatments by ROCL complier
. ttest purchase if roclkill == 0, by(ii_ae)

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
---------+--------------------------------------------------------------------
Actuaria |   4,914    .5891331    .0070191    .4920412    .5753724    .6028937
Index In |   3,564    .5656566     .008304      .49574    .5493756    .5819376
---------+--------------------------------------------------------------------
Combined |   8,478     .579264    .0053619    .4937064    .5687533    .5897747
---------+--------------------------------------------------------------------
    diff |            .0234765    .0108601                 .002188     .044765
------------------------------------------------------------------------------
    diff = mean(Actuaria) - mean(Index In)                        t =   2.1617
H0: diff = 0                                     Degrees of freedom =     8476

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.9847         Pr(|T| > |t|) = 0.0307          Pr(T > t) = 0.0153

. 
. 
. * Tabulations of correct choices for Table 4:
. ********************************************
. 
. * Purchase of ROCL violators in AE treatment
. sum correct_rdu if roclkill == 1 & ii_ae == 0 

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
 correct_rdu |      1,404    .4985755    .5001761          0          1

. 
. * Purchase of ROCL compliers in AE treatment
. sum correct_rdu if roclkill == 0 & ii_ae == 0 

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
 correct_rdu |      4,968    .4961755    .5000357          0          1

. 
. * Difference in means test in AE treatment
. ttest correct_rdu if ii_ae == 0, by(roclkill)

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
---------+--------------------------------------------------------------------
       0 |   4,968    .4961755    .0070943    .5000357    .4822675    .5100835
       1 |   1,404    .4985755    .0133487    .5001761    .4723899    .5247611
---------+--------------------------------------------------------------------
Combined |   6,372    .4967043    .0062641    .5000284    .4844246     .508984
---------+--------------------------------------------------------------------
    diff |              -.0024    .0151144               -.0320293    .0272294
------------------------------------------------------------------------------
    diff = mean(0) - mean(1)                                      t =  -0.1588
H0: diff = 0                                     Degrees of freedom =     6370

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.4369         Pr(|T| > |t|) = 0.8738          Pr(T > t) = 0.5631

. 
. 
. * Purchase of ROCL violators in II treatment
. sum correct_rdu if roclkill == 1 & ii_ae == 1

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
 correct_rdu |        972    .4423868    .4969253          0          1

. 
. * Purchase of ROCL compliers in II treatment
. sum correct_rdu if roclkill == 0 & ii_ae == 1 

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
 correct_rdu |      3,564    .5187991    .4997166          0          1

. 
. * Difference in means test in II treatment
. ttest correct_rdu if ii_ae == 1, by(roclkill)

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
---------+--------------------------------------------------------------------
       0 |   3,564    .5187991    .0083706    .4997166    .5023875    .5352107
       1 |     972    .4423868    .0159389    .4969253    .4111082    .4736655
---------+--------------------------------------------------------------------
Combined |   4,536     .502425    .0074247    .5000492    .4878691     .516981
---------+--------------------------------------------------------------------
    diff |            .0764123    .0180609                .0410041    .1118205
------------------------------------------------------------------------------
    diff = mean(0) - mean(1)                                      t =   4.2308
H0: diff = 0                                     Degrees of freedom =     4534

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 1.0000         Pr(|T| > |t|) = 0.0000          Pr(T > t) = 0.0000

. 
. 
. * Difference in means test in across treatments by ROCL violator
. ttest correct_rdu  if roclkill == 1, by(ii_ae)

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
---------+--------------------------------------------------------------------
Actuaria |   1,404    .4985755    .0133487    .5001761    .4723899    .5247611
Index In |     972    .4423868    .0159389    .4969253    .4111082    .4736655
---------+--------------------------------------------------------------------
Combined |   2,376    .4755892    .0102475    .4995089    .4554942    .4956843
---------+--------------------------------------------------------------------
    diff |            .0561887     .020815                .0153713    .0970061
------------------------------------------------------------------------------
    diff = mean(Actuaria) - mean(Index In)                        t =   2.6994
H0: diff = 0                                     Degrees of freedom =     2374

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.9965         Pr(|T| > |t|) = 0.0070          Pr(T > t) = 0.0035

. 
. * Difference in means test in across treatments by ROCL complier
. ttest correct_rdu  if roclkill == 0, by(ii_ae)

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. err.   Std. dev.   [95% conf. interval]
---------+--------------------------------------------------------------------
Actuaria |   4,968    .4961755    .0070943    .5000357    .4822675    .5100835
Index In |   3,564    .5187991    .0083706    .4997166    .5023875    .5352107
---------+--------------------------------------------------------------------
Combined |   8,532    .5056259    .0054131    .4999977     .495015    .5162368
---------+--------------------------------------------------------------------
    diff |           -.0226236    .0109736               -.0441346   -.0011126
------------------------------------------------------------------------------
    diff = mean(Actuaria) - mean(Index In)                        t =  -2.0616
H0: diff = 0                                     Degrees of freedom =     8530

    Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T < t) = 0.0196         Pr(|T| > |t|) = 0.0393          Pr(T > t) = 0.9804

. 
. log off app
      name:  app
       log:  D:\JRI Distribution -- Data and Code\JRI -- Welfare Consequences of the Compound Risks of Index Insurance -- Selected Results.log
  log type:  text
 paused on:  20 Apr 2025, 13:35:04
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  app
       log:  D:\JRI Distribution -- Data and Code\JRI -- Welfare Consequences of the Compound Risks of Index Insurance -- Selected Results.log
  log type:  text
resumed on:  20 Apr 2025, 13:35:04

. 
. * log for Figures 6 and 7
. 
. * logit
. logit purchase $actuarial

Iteration 0:  Log likelihood = -7338.4711  
Iteration 1:  Log likelihood = -7327.3238  
Iteration 2:  Log likelihood = -7327.3227  
Iteration 3:  Log likelihood = -7327.3227  

Logistic regression                                     Number of obs = 10,854
                                                        LR chi2(4)    =  22.30
                                                        Prob > chi2   = 0.0002
Log likelihood = -7327.3227                             Pseudo R2     = 0.0015

------------------------------------------------------------------------------
    purchase | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
    probLOSS |   -.709517   .4620752    -1.54   0.125    -1.615168    .1961337
  amountLOSS |   .0023167   .0033999     0.68   0.496     -.004347    .0089804
     loading |  -.2157564   .0767556    -2.81   0.005    -.3661946   -.0653181
           m |   -.192775   .0678763    -2.84   0.005    -.3258101     -.05974
       _cons |   .4968946   .1176089     4.22   0.000     .2663853    .7274038
------------------------------------------------------------------------------

. 
. * Figure 6
. local fload "-.3 "-0.3" -0.2 "-0.2" 0 "0" .2 "+0.2" .3 "+0.3""

. margins, at(loading=(-0.5 -0.3 -0.2 0 0.2 0.3)) contrast(atcontrast(r) ci pv)

Contrasts of predictive margins                         Number of obs = 10,854
Model VCE: OIM

Expression: Pr(purchase), predict()
1._at: loading = -.5
2._at: loading = -.3
3._at: loading = -.2
4._at: loading =   0
5._at: loading =  .2
6._at: loading =  .3

------------------------------------------------
             |         df        chi2     P>chi2
-------------+----------------------------------
         _at |
   (2 vs 1)  |          1        8.15     0.0043
   (3 vs 1)  |          1        8.11     0.0044
   (4 vs 1)  |          1        8.03     0.0046
   (5 vs 1)  |          1        7.97     0.0048
   (6 vs 1)  |          1        7.94     0.0048
      Joint  |          2      338.68     0.0000
------------------------------------------------

-----------------------------------------------------
             |            Delta-method
             |   Contrast   std. err.      z    P>|z|
-------------+---------------------------------------
         _at |
   (2 vs 1)  |   -.010262   .0035944    -2.86   0.004
   (3 vs 1)  |  -.0154282    .005418    -2.85   0.004
   (4 vs 1)  |  -.0258256   .0091127    -2.83   0.005
   (5 vs 1)  |  -.0363025   .0128629    -2.82   0.005
   (6 vs 1)  |   -.041568   .0147558    -2.82   0.005
-----------------------------------------------------

--------------------------------------------------------------
             |            Delta-method
             |   Contrast   std. err.     [95% conf. interval]
-------------+------------------------------------------------
         _at |
   (2 vs 1)  |   -.010262   .0035944     -.0173069   -.0032172
   (3 vs 1)  |  -.0154282    .005418     -.0260474   -.0048091
   (4 vs 1)  |  -.0258256   .0091127     -.0436862    -.007965
   (5 vs 1)  |  -.0363025   .0128629     -.0615133   -.0110917
   (6 vs 1)  |   -.041568   .0147558     -.0704889   -.0126472
--------------------------------------------------------------

. marginsplot, xlabel(`fload') yline(0, lpattern(dash) lcolor(red)) ytitle("Effect on" "Probability" "of Purchase", orient(horizontal)) ylabel(, angle(horizontal)) title ("") xtitle("Fractional loading by desig
> n, compared to -0.5", margin(medium)) plotopts(mcolor(blue) lcolor(blue)) ciopts(lcolor(blue)) saving(loadingALL.gph, replace)

Variables that uniquely identify margins: loading
file loadingALL.gph saved

. gr export loadingALL.png, replace
file loadingALL.png saved as PNG format

. 
. * Figure 7
. local match ".2 "0.2" 0.4 "0.2" .6 "0.6" .8 "0.8" 1 "1""

. margins, at(m=(0 0.2 0.4 0.6 0.8 1)) contrast(atcontrast(r) ci pv)

Contrasts of predictive margins                         Number of obs = 10,854
Model VCE: OIM

Expression: Pr(purchase), predict()
1._at: m =  0
2._at: m = .2
3._at: m = .4
4._at: m = .6
5._at: m = .8
6._at: m =  1

------------------------------------------------
             |         df        chi2     P>chi2
-------------+----------------------------------
         _at |
   (2 vs 1)  |          1        8.46     0.0036
   (3 vs 1)  |          1        8.37     0.0038
   (4 vs 1)  |          1        8.29     0.0040
   (5 vs 1)  |          1        8.22     0.0041
   (6 vs 1)  |          1        8.16     0.0043
      Joint  |          2      403.80     0.0000
------------------------------------------------

-----------------------------------------------------
             |            Delta-method
             |   Contrast   std. err.      z    P>|z|
-------------+---------------------------------------
         _at |
   (2 vs 1)  |  -.0091076   .0031317    -2.91   0.004
   (3 vs 1)  |  -.0182938   .0063231    -2.89   0.004
   (4 vs 1)  |  -.0275529   .0095681    -2.88   0.004
   (5 vs 1)  |  -.0368787   .0128604    -2.87   0.004
   (6 vs 1)  |  -.0462649   .0161934    -2.86   0.004
-----------------------------------------------------

--------------------------------------------------------------
             |            Delta-method
             |   Contrast   std. err.     [95% conf. interval]
-------------+------------------------------------------------
         _at |
   (2 vs 1)  |  -.0091076   .0031317     -.0152456   -.0029696
   (3 vs 1)  |  -.0182938   .0063231     -.0306869   -.0059008
   (4 vs 1)  |  -.0275529   .0095681     -.0463061   -.0087997
   (5 vs 1)  |  -.0368787   .0128604     -.0620847   -.0116727
   (6 vs 1)  |  -.0462649   .0161934     -.0780035   -.0145264
--------------------------------------------------------------

. marginsplot, xlabel(`match') yline(0, lpattern(dash) lcolor(red)) ytitle("Effect on" "Probability" "of Purchase", orient(horizontal)) ylabel(, angle(horizontal)) title ("") xtitle("Index matching probability,
>  compared to 0", margin(medium)) plotopts(mcolor(blue) lcolor(blue)) ciopts(lcolor(blue)) saving(matchingALL.gph, replace)

Variables that uniquely identify margins: m
file matchingALL.gph saved

. gr export matchingALL.png, replace
file matchingALL.png saved as PNG format

. 
. log off app
      name:  app
       log:  D:\JRI Distribution -- Data and Code\JRI -- Welfare Consequences of the Compound Risks of Index Insurance -- Selected Results.log
  log type:  text
 paused on:  20 Apr 2025, 13:35:08
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  app
       log:  D:\JRI Distribution -- Data and Code\JRI -- Welfare Consequences of the Compound Risks of Index Insurance -- Selected Results.log
  log type:  text
resumed on:  20 Apr 2025, 13:35:08

. 
. * Figure 5
. 
. * regressions
. xtlogit purchase i.roclkill##i.ii_ae $demog_reg $actuarial_norm, vce(cluster SID_all)

Fitting comparison model:

Iteration 0:  Log pseudolikelihood = -7338.4711  
Iteration 1:  Log pseudolikelihood =   -7250.88  
Iteration 2:  Log pseudolikelihood = -7250.6531  
Iteration 3:  Log pseudolikelihood = -7250.6531  

Fitting full model:

tau =  0.0    Log pseudolikelihood = -7250.6531
tau =  0.1    Log pseudolikelihood = -6692.4117
tau =  0.2    Log pseudolikelihood = -6532.8956
tau =  0.3    Log pseudolikelihood = -6460.7693
tau =  0.4    Log pseudolikelihood = -6426.3752
tau =  0.5    Log pseudolikelihood = -6415.9647
tau =  0.6    Log pseudolikelihood = -6428.1829

Iteration 0:  Log pseudolikelihood =  -6407.598  
Iteration 1:  Log pseudolikelihood = -6402.2081  
Iteration 2:  Log pseudolikelihood = -6402.1757  
Iteration 3:  Log pseudolikelihood = -6402.1757  

Calculating robust standard errors ...

Random-effects logistic regression                   Number of obs    = 10,854
Group variable: SID_all                              Number of groups =    201

Random effects u_i ~ Gaussian                        Obs per group:
                                                                  min =     54
                                                                  avg =   54.0
                                                                  max =     54

Integration method: mvaghermite                      Integration pts. =     12

                                                     Wald chi2(15)    =  25.53
Log pseudolikelihood = -6402.1757                    Prob > chi2      = 0.0433

                                    (Std. err. adjusted for 201 clusters in SID_all)
------------------------------------------------------------------------------------
                   |               Robust
          purchase | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
-------------------+----------------------------------------------------------------
        1.roclkill |   .0782194   .3294468     0.24   0.812    -.5674845    .7239233
                   |
             ii_ae |
  Index Insurance  |  -.1014451   .1959356    -0.52   0.605    -.4854717    .2825816
                   |
    roclkill#ii_ae |
1#Index Insurance  |    .809106   .5140134     1.57   0.115    -.1983418    1.816554
                   |
            female |   -.246185   .1802845    -1.37   0.172    -.5995362    .1071662
               age |   .0154706   .0144094     1.07   0.283    -.0127712    .0437125
             black |   .1434297   .2106321     0.68   0.496    -.2694016     .556261
          business |  -.0520095   .1965198    -0.26   0.791    -.4371812    .3331623
            single |  -.4088767   .2868079    -1.43   0.154    -.9710099    .1532566
              nhhd |  -.0560495   .0491956    -1.14   0.255    -.1524711    .0403722
           working |  -.0299504   .1999083    -0.15   0.881    -.4217636    .3618627
             money |  -.0005414    .009062    -0.06   0.952    -.0183026    .0172198
      probLOSSnorm |  -.0367842   .0535352    -0.69   0.492    -.1417112    .0681428
    amountLOSSnorm |  -.1086192   .1040628    -1.04   0.297    -.3125784    .0953401
       loadingnorm |  -.1520991   .0782974    -1.94   0.052    -.3055593     .001361
             mnorm |  -.1106443   .0677017    -1.63   0.102    -.2433372    .0220487
             _cons |    1.05823   .4647791     2.28   0.023     .1472796     1.96918
-------------------+----------------------------------------------------------------
          /lnsig2u |   .3254713   .1704883                     -.0086796    .6596221
-------------------+----------------------------------------------------------------
           sigma_u |   1.176726   .1003089                      .9956696    1.390705
               rho |   .2962173   .0355421                      .2315594    .3702311
------------------------------------------------------------------------------------

. margins, dydx(1.roclkill) at(ii_ae=(0 1)) level(95) post // +30pp, sig

Average marginal effects                                Number of obs = 10,854
Model VCE: Robust

Expression: Pr(purchase=1), predict(pr)
dy/dx wrt:  1.roclkill
1._at: ii_ae = 0
2._at: ii_ae = 1

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
0.roclkill   |  (base outcome)
-------------+----------------------------------------------------------------
1.roclkill   |
         _at |
          1  |   .0147363   .0618856     0.24   0.812    -.1065573      .13603
          2  |   .1581504   .0617615     2.56   0.010     .0371001    .2792007
------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.

. est sto purch_roclkill

. 
. * Figure B
. coefplot (purch_roclkill, mcolor(dknavy) ciopts(lcol(dknavy)) mlabels(1.roclkill:1._at=1 "ROCL violators" 1.roclkill:2._at=1 "ROCL violators") mlabtextstyle(heading) ), drop(_cons $actuarial_norm $demog_reg) 
> xline(0) xtitle("Change in Purchase Probability", margin(small)) xscale(range(-0.1 0.3)) xlabel(-0.1(0.1)0.3) nokey levels(95) mlabposition(12) coeflabels(1._at = "AE" 2._at = "II") saving(FigB_purchrocl.gph,
>  replace)
file FigB_purchrocl.gph saved

. gr export FigB_purchrocl.png, replace
file FigB_purchrocl.png saved as PNG format

. 
. log off app
      name:  app
       log:  D:\JRI Distribution -- Data and Code\JRI -- Welfare Consequences of the Compound Risks of Index Insurance -- Selected Results.log
  log type:  text
 paused on:  20 Apr 2025, 13:35:22
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  app
       log:  D:\JRI Distribution -- Data and Code\JRI -- Welfare Consequences of the Compound Risks of Index Insurance -- Selected Results.log
  log type:  text
resumed on:  20 Apr 2025, 13:35:22

. 
. * Tabulations for comparisons of means across treatments in page 33
. 
. * Efficiency in II treatments of ROCL violators and ROCL compliers
. sum eff_reg_RDU if ii_ae == 1 & roclkill==1 & record == 1

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
 eff_reg_RDU |         16    .3936023    .2082225      .0001   .6666803

. sum eff_reg_RDU if ii_ae == 1 & roclkill==0 & record == 1

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
 eff_reg_RDU |         63     .503721    .1750349   .1398842   .9951162

. 
. * Efficiency in II treatments of ROCL violators and ROCL compliers
. sum eff_reg_RDU if ii_ae == 0 & roclkill==1 & record == 1

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
 eff_reg_RDU |         25    .4649977    .2099067   .0884103    .964451

. sum eff_reg_RDU if ii_ae == 0 & roclkill==0 & record == 1

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
 eff_reg_RDU |         86     .470112    .1879737   .0618333   .9706801

. 
. 
. * log for Figure 8
. betareg eff_reg_RDU i.ii_ae $demog_reg if record==1
Initial:      Log likelihood =  28.774537
Rescale:      Log likelihood =  28.774537
Rescale eq:   Log likelihood =  28.774537
(setting technique to bhhh)
Iteration 0:  Log likelihood =  28.774537  
Iteration 1:  Log likelihood =  31.725075  
Iteration 2:  Log likelihood =  32.093591  
Iteration 3:  Log likelihood =  32.357689  
Iteration 4:  Log likelihood =   32.65725  
Iteration 5:  Log likelihood =  32.805385  
Iteration 6:  Log likelihood =  32.825365  
Iteration 7:  Log likelihood =  32.856725  
Iteration 8:  Log likelihood =  32.978698  
Iteration 9:  Log likelihood =  33.003825  
(switching technique to nr)
Iteration 10: Log likelihood =  33.017046  
Iteration 11: Log likelihood =  33.074422  
Iteration 12: Log likelihood =   33.07444  
Iteration 13: Log likelihood =   33.07444  

Beta regression                                 Number of obs     =        190
                                                LR chi2(9)        =       4.68
                                                Prob > chi2       =     0.8613

Link function  :  g(u) = log(u/(1-u))           [Logit]
Slink function :  g(u) = log(u)                 [Log]

Log likelihood =   33.07444

----------------------------------------------------------------------------------
     eff_reg_RDU | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-----------------+----------------------------------------------------------------
eff_reg_RDU      |
           ii_ae |
Index Insurance  |  -.0493892   .1256209    -0.39   0.694    -.2956018    .1968233
          female |   .0082945   .1272979     0.07   0.948    -.2412047    .2577938
             age |  -.0081141   .0104511    -0.78   0.438    -.0285978    .0123697
           black |   .0664592     .14341     0.46   0.643    -.2146192    .3475376
        business |   .0309119   .1397538     0.22   0.825    -.2430006    .3048244
          single |  -.0724424   .1963075    -0.37   0.712     -.457198    .3123131
            nhhd |  -.0074174   .0330271    -0.22   0.822    -.0721492    .0573145
         working |   .1632653   .1304555     1.25   0.211    -.0924229    .4189534
           money |   -.009098    .006075    -1.50   0.134    -.0210048    .0028089
           _cons |   .0652943   .3450684     0.19   0.850    -.6110273    .7416159
-----------------+----------------------------------------------------------------
scale            |
           _cons |   1.516305   .0933624    16.24   0.000     1.333318    1.699291
----------------------------------------------------------------------------------

. 
. *significant differences
. betareg eff_reg_RDU i.roclkill##i.ii_ae $demog_reg if record==1
Initial:      Log likelihood =  37.478155
Rescale:      Log likelihood =  37.478155
Rescale eq:   Log likelihood =  37.478155
(setting technique to bhhh)
Iteration 0:  Log likelihood =  37.478155  
Iteration 1:  Log likelihood =  39.597548  
Iteration 2:  Log likelihood =  39.868847  
Iteration 3:  Log likelihood =  39.938953  
Iteration 4:  Log likelihood =  40.100349  
Iteration 5:  Log likelihood =  40.110776  
Iteration 6:  Log likelihood =  40.131047  
Iteration 7:  Log likelihood =  40.136093  
Iteration 8:  Log likelihood =  40.136355  
Iteration 9:  Log likelihood =  40.142745  
(switching technique to nr)
Iteration 10: Log likelihood =  40.143911  
Iteration 11: Log likelihood =  40.147631  
Iteration 12: Log likelihood =  40.147631  

Beta regression                                 Number of obs     =        190
                                                LR chi2(11)       =      18.83
                                                Prob > chi2       =     0.0643

Link function  :  g(u) = log(u/(1-u))           [Logit]
Slink function :  g(u) = log(u)                 [Log]

Log likelihood =  40.147631

------------------------------------------------------------------------------------
       eff_reg_RDU | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------------+----------------------------------------------------------------
eff_reg_RDU        |
        1.roclkill |  -.0492879   .1903587    -0.26   0.796     -.422384    .3238083
                   |
             ii_ae |
  Index Insurance  |   .1397011    .138322     1.01   0.313    -.1314051    .4108072
                   |
    roclkill#ii_ae |
1#Index Insurance  |  -.8441682     .30557    -2.76   0.006    -1.443074   -.2452621
                   |
            female |   .1138808   .1277349     0.89   0.373     -.136475    .3642367
               age |  -.0051358   .0101918    -0.50   0.614    -.0251113    .0148397
             black |   .0292486   .1409116     0.21   0.836    -.2469331    .3054303
          business |   .0567831   .1377286     0.41   0.680      -.21316    .3267263
            single |  -.0489689   .1908016    -0.26   0.797    -.4229331    .3249954
              nhhd |    .001153   .0321953     0.04   0.971    -.0619485    .0642546
           working |   .1636066   .1272152     1.29   0.198    -.0857306    .4129437
             money |  -.0106892   .0058934    -1.81   0.070    -.0222401    .0008617
             _cons |  -.0332952   .3362917    -0.10   0.921    -.6924147    .6258244
-------------------+----------------------------------------------------------------
scale              |
             _cons |   1.590167   .0940103    16.91   0.000     1.405911    1.774424
------------------------------------------------------------------------------------

. 
. * text -- be careful with the 1 and 2 here, read the labels!
. margins, dydx(1.roclkill) at(ii_ae=(0 1)) level(95) post

Average marginal effects                                   Number of obs = 190
Model VCE: OIM

Expression: Conditional mean of eff_reg_RDU, predict()
dy/dx wrt:  1.roclkill
1._at: ii_ae = 0
2._at: ii_ae = 1

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
0.roclkill   |  (base outcome)
-------------+----------------------------------------------------------------
1.roclkill   |
         _at |
          1  |  -.0122247   .0471691    -0.26   0.796    -.1046744    .0802251
          2  |  -.2109324   .0526422    -4.01   0.000    -.3141093   -.1077555
------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.

. est sto eff_roclkill

. 
. * Figure 8
. local welf "-.4 "-0.4" -.3 "-0.3" -0.2 "-0.2" -.1 "-0.1" 0 "0" .1 "+0.1" .2 "+0.2""

. coefplot (eff_roclkill, mcolor(dknavy) ciopts(lcol(dknavy)) mlabels(1.roclkill:1._at=1 "ROCL violators" 1.roclkill:2._at=1 "ROCL violators") mlabtextstyle(heading) ), drop(_cons $actuarial_norm $demog_reg) xl
> ine(0) xscale(range(-0.4 0.2)) xlabel(`welf') nokey levels(95) mlabposition(12) coeflabels(1._at = "AE" 2._at = "II") saving(FigD.gph, replace)
file FigD.gph saved

. gr export FigD.png, replace
file FigD.png saved as PNG format

. 
. * log for Figure 9
. 
. *significant differences
. betareg eff_reg_recRDU i.roclkill##i.ii_ae $demog_reg if record==1
Initial:      Log likelihood =  8.8634834
Rescale:      Log likelihood =  9.6479029
Rescale eq:   Log likelihood =  9.6479029
(setting technique to bhhh)
Iteration 0:  Log likelihood =  9.6479029  
Iteration 1:  Log likelihood =  13.197411  
Iteration 2:  Log likelihood =  14.409746  
Iteration 3:  Log likelihood =  14.567944  
Iteration 4:  Log likelihood =  15.068438  
Iteration 5:  Log likelihood =  15.219643  
Iteration 6:  Log likelihood =  15.649594  
Iteration 7:  Log likelihood =   15.77517  
Iteration 8:  Log likelihood =  16.013782  
Iteration 9:  Log likelihood =   16.10472  
(switching technique to nr)
Iteration 10: Log likelihood =   16.24738  
Iteration 11: Log likelihood =  17.092085  
Iteration 12: Log likelihood =   17.09556  
Iteration 13: Log likelihood =   17.09556  

Beta regression                                 Number of obs     =        181
                                                LR chi2(11)       =      12.96
                                                Prob > chi2       =     0.2957

Link function  :  g(u) = log(u/(1-u))           [Logit]
Slink function :  g(u) = log(u)                 [Log]

Log likelihood =   17.09556

------------------------------------------------------------------------------------
    eff_reg_recRDU | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------------+----------------------------------------------------------------
eff_reg_recRDU     |
        1.roclkill |  -.2384134   .2408626    -0.99   0.322    -.7104954    .2336685
                   |
             ii_ae |
  Index Insurance  |   .0265649    .175179     0.15   0.879    -.3167796    .3699094
                   |
    roclkill#ii_ae |
1#Index Insurance  |   -.357993   .3809638    -0.94   0.347    -1.104668    .3886823
                   |
            female |  -.0421087   .1602878    -0.26   0.793     -.356267    .2720495
               age |  -.0069181   .0127288    -0.54   0.587    -.0318662    .0180299
             black |   .0040398    .173945     0.02   0.981    -.3368861    .3449657
          business |  -.0229308   .1682978    -0.14   0.892    -.3527884    .3069269
            single |   .1957102   .2501477     0.78   0.434    -.2945704    .6859908
              nhhd |   .0814692   .0395836     2.06   0.040     .0038868    .1590517
           working |   .1644292   .1597586     1.03   0.303     -.148692    .4775503
             money |   -.001115    .007309    -0.15   0.879    -.0154404    .0132104
             _cons |  -.6318233    .425736    -1.48   0.138    -1.466251    .2026039
-------------------+----------------------------------------------------------------
scale              |
             _cons |   1.035313   .0925997    11.18   0.000      .853821    1.216805
------------------------------------------------------------------------------------

. 
. * text -- be careful with the 1 and 2 here, read the labels!
. margins, dydx(1.roclkill) at(ii_ae=(0 1)) level(95) post

Average marginal effects                                   Number of obs = 181
Model VCE: OIM

Expression: Conditional mean of eff_reg_recRDU, predict()
dy/dx wrt:  1.roclkill
1._at: ii_ae = 0
2._at: ii_ae = 1

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
0.roclkill   |  (base outcome)
-------------+----------------------------------------------------------------
1.roclkill   |
         _at |
          1  |  -.0568437    .056574    -1.00   0.315    -.1677267    .0540394
          2  |  -.1368708   .0647968    -2.11   0.035    -.2638702   -.0098715
------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.

. est sto eff_roclkill_recRDU

. 
. * Figure 9
. local welf "-.4 "-0.4" -.3 "-0.3" -0.2 "-0.2" -.1 "-0.1" 0 "0" .1 "+0.1" .2 "+0.2""

. coefplot (eff_roclkill_recRDU, mcolor(dknavy) ciopts(lcol(dknavy)) mlabels(1.roclkill:1._at=1 "ROCL violators" 1.roclkill:2._at=1 "ROCL violators") mlabtextstyle(heading) ), drop(_cons $actuarial_norm $demog_
> reg) xline(0) xscale(range(-0.4 0.2)) xlabel(`welf') nokey levels(95) mlabposition(12) coeflabels(1._at = "AE" 2._at = "II") saving(FigE.gph, replace)
file FigE.gph saved

. gr export FigE.png, replace
file FigE.png saved as PNG format

. 
. log off app
      name:  app
       log:  D:\JRI Distribution -- Data and Code\JRI -- Welfare Consequences of the Compound Risks of Index Insurance -- Selected Results.log
  log type:  text
 paused on:  20 Apr 2025, 13:35:26
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
